1. Field of the Invention
The present invention relates generally to computer graphics systems, and more specifically to a method for global rendering of multidimensional textures.
2. Related Art
Computer rendering is the art of representing a three dimensional (3D) object or scene in the two dimensional (2D) space of a computer screen or other flat medium. Vast increases in computing power have resulted in increasingly complex and sophisticated computer applications. Such applications often call for equally sophisticated and complex computer rendering. Typically, 3D objects are rendered, or modeled, as a collection of joined polygons (typically triangles) defined by vertex positions and attributes. The end result of the rendering process is a collection of pixels for each surface of the projected polygon.
In early rendering processes, designers would take a picture of an object, such as a tree or a person, and simply map that image to a vertical plane oriented towards the viewpoint in their scene. In this fashion, one could place various objects into the scene and have them appear natural. This technique is analogous to placing a number of billboards into the scene, each oriented toward the viewer. This worked well for static scenes but, for the dynamic effects required by animation, and for more complex lighting schemes, it was clear that the objects are really two dimensional billboards.
Traditionally, designers wishing to render a 3D object, such as a person or a tree, would take a series of photographs of that object, for example, around an entire 360 degree panorama with each photograph offset by one or two degrees from the previous photograph. This plurality of images was then combined into a single file. Such a file is often referred to as a multidimensional texture (MDT). When the rendering operation was performed, the software would place an empty plane representing the object in the scene to be rendered, and would select, from the plurality of images in the file, the image corresponding to the current viewpoint, i.e. the image that was facing the viewer. In this fashion, if the viewer is looking at the front of the object, the software will pick the image representing that side. If the viewer were looking at the back of the object, the software would pick the image representing the back of the object. It will be appreciated, however, that this image is still just a two dimensional plane in the scene, i.e., it is still just like a billboard.
Because images are still represented by a plane or a billboard, it is difficult to perform complex lighting and shading operations in the scene. This is particularly true when the scene contains a plurality of light sources, or when the light source is perpendicular to the 2D billboard representing the object. These sorts of complex rendering operations are referred to herein as xe2x80x9cglobal rendering.xe2x80x9d It will be appreciated that such global rendering has the potential to enhance realism by modeling real world visual effects such as shadows, surface shading, and illumination from various different sources of light.
The disadvantages of the billboard technique are illustrated in FIGS. 1A and 1B. Each illustration is an actual rendering using a conventional rendering method, and each illustration represents the same view of a multi-dimensional texture object 104 placed in a room with two mirrored walls 112 and 114. The large object in the middle of the view is the object as seen from the viewpoint location. The other three objects 106, 108 and 110 in each view are reflections of the object 104 in the mirrored walls.
FIG. 1A shows the single, static rectangle used by the conventional method to render MDTs. For each MDT object, a vertical rectangle 104 is placed in the scene 102 and oriented so that it is perpendicular to the view direction. A single texture image from the MDT file is extracted and mapped to this rectangle. A shadow 116 is cast from a light source that is perpendicular to the view direction.
FIG. 1B shows a single texture from the MDT file mapped to the rectangle in FIG. 1A. The foreground object 118 displays the correct side view of the texture object. However, there are several problems inherent with this method when global light effects are considered. First, the reflections of the foreground object 120, 122 and 124 in the mirrored walls incorrectly display the same side view of the texture as the foreground object. Second, the reflected images of the object (especially reflection 124) are distorted because the reflected planes are not perpendicular to the view direction. Third, the shadow 126 cast by the foreground object is extremely thin. This is because the direction of the light source is almost parallel to the plane of the foreground object 118. The limitations of the established method result in incorrect and distorted views of the object from the other view locations.
It would be desirable, therefore, to provide a method of rendering that allows more realistic global illumination and rendering of 3D scenes.
In an exemplary embodiment of the present invention, a system, method and computer program product for global rendering of multidimensional textures (MDTs) using bounded volumes are disclosed. By using bounded volumes, objects to be rendered receive more realistic representation in a scene.
It is an advantage of the present invention that an image in a computer can be rendered realistically from any view simultaneously. By using bounding geometry combined with multi-dimensional texture files, the present invention eliminates the problems of incorrect shadows, distorted views and incorrect lighting effects that existed with previous techniques of rendering that only rendered one view at a time.
In an exemplary embodiment, the present invention can be a method in a computer system for global rendering of a multidimensional texture map including the steps of placing an object representing a multidimensional texture map into a database, replacing the object with a bounding geometry, sampling the bounding geometry with a sample of interest having an origin and a direction, extracting pixel information used for global rendering of the object from the sample of the bounding geometry, and displaying the object using the extracted pixel information. The bounding geometry can be a volume that completely encloses the object, and can be a cylinder with height equal to the object, and diameter equal to the width of the object, and the cylinder can be capped by a hemisphere of the same diameter. The sample of interest can be determined by an external rendering engine, and the origin can be for example, a camera, a light source or a point on a reflecting surface.
The pixel information extraction step can further include the steps of computing a direction from the center of the bounding geometry to the origin of the sample of interest, identifying a vertical plane that contains the center point of the bounding geometry and that is perpendicular to the sample of interest, projecting the sample onto the vertical plane, computing a coordinate of the projected sample in the vertical plane, extracting an image from a multi-dimensional texture where the image faces the computed direction, extracting a pixel from the image that corresponds to the coordinate, and extracting texture information about the pixel. The texture information can be the color, transparency, Z-depth, or surface normal of the extracted pixel.
Computing a coordinate of the projected sample in the vertical plane can include setting a coordinate origin at the lower left corner of the vertical plane as viewed from the origin of the sample of interest, computing a U coordinate of the projected sample as the horizontal distance from the coordinate origin to the projected sample, and computing a V coordinate of the projected sample as the vertical the coordinate origin to the projected sample.
In an alternative exemplary embodiment, the present invention can be a system that performs global rendering of a multidimensional texture map including a processor, a memory coupled to the processor, a rendering engine executable by the processor, a multidimensional texture (MDT) map global rendering module executable by the processor operative to render MDT""s globally, where the MDT map global rendering module includes a placement module operative to place an object representing a MDT map into a database, a replacement module that replaces the object with a bounding geometry, a sampler that samples the bounding geometry with a sample of interest comprising an origin and a direction, and an pixel information extractor that extracts pixel information, used for global rendering of the object by the rendering engine, from the sample of the bounding geometry. The system of the present invention can further include a display. In the system, the bounding geometry can be a volume that completely encloses the object, and the volume can be a cylinder with a height equal to the object, and a diameter equal to the width of the object; and wherein the cylinder is capped by a hemisphere of the same diameter. The sample of interest can be determined by an external rendering engine. The origin of the sample of interest can be a camera, a light source or a point on a reflecting surface.
The system""s pixel information extractor can include a direction calculator that computes a direction from the center of the bounding geometry to the origin of the sample of interest, an identifier that identifies a vertical plane that contains the center point of the bounding geometry and that is perpendicular to the sample of interest, a projector that projects the sample onto the vertical plane, a coordinate calculator that computes a coordinate of the projected sample in the vertical plane, an image extractor that extracts an image from a multi-dimensional texture wherein the image faces the computed direction, a pixel extractor that extracts a pixel from the image that corresponds to the coordinate, and a texture extractor that extracts a color, a transparency, a z-depth, or a surface normal of the extracted pixel.
In yet another embodiment, the present invention can be a computer program product, including program logic, embodied on a computer readable medium, where the computer program product includes global rendering means for global rendering of a multidimensional texture map. The global rendering means includes placement means for placing an object representing a MDT map into a database, replacement means for replacing the object with a bounding geometry, sampling means for sampling the bounding geometry with a sample of interest comprising an origin and a direction, and pixel information extraction means for extracting from the bounding geometry pixel information used for global rendering of the object. The computer program can further include display means for displaying the extracted pixel information.
The pixel information extraction means can include direction calculation means for computing a direction from the center of the bounding geometry to the origin of the sample of interest, identification means for identifying a vertical plane that contains the center point of the bounding geometry and that is perpendicular to the sample of interest, projection means for projecting the sample onto the vertical plane, coordinate computation means for computing a coordinate of the projected sample in the vertical plane, image extraction means for extracting an image from a multi-dimensional texture wherein the image faces the computed direction, pixel extraction means for extracting a pixel from the image that corresponds to the coordinate, and texture extraction means for extracting a color, a transparency, a Z-depth or a surface normal of the extracted pixel.
The computer program product""s bounding geometry can be a volume that completely encloses the object. The volume can be a cylinder with a height equal to the object, and a diameter equal to the width of the object, and the cylinder can be capped by a hemisphere of the same diameter.
In yet another embodiment, the present invention can be system for global rendering of a multidimensional texture map including global rendering means for multidimensional texture (MDT) map global rendering, which includes placement means for placing an object representing a MDT map into a database, replacement means for replacing the object with a bounding geometry, sampling means for sampling the bounding geometry with a sample of interest comprising an origin and a direction, and pixel information extracting means for extracting pixel information, used for global rendering of the object, from the sample of the bounding geometry. The system can further include display means for displaying the extracted pixel information.
Further features and advantages of the invention, as well as the structure and operation of various embodiments of the invention, are described in detail below with reference to the accompanying drawings.